using System;
using System.ComponentModel;
using System.Data;
using System.Collections.Generic;

namespace PlacementManager
{
    
    public partial class LinkVenuePlacementTypeComponent
    {
		//
		// TODO: Add constructor logic here
		//

        /// <summary>
        /// Selects all records from the database table based on a foreign key.
        /// </summary>
        /// <returns>A collection of objects of a type representing a row in the database table.</returns>
        [DataObjectMethodAttribute(DataObjectMethodType.Select, false)]
        public List<LinkVenuePlacementType> SelectAllWPlacementTypeIdActiveOrdered(int PlacementTypeId)
        {
            List<LinkVenuePlacementType> listLinkVenuePlacementType = new List<LinkVenuePlacementType>();
            PlacementManager.DAL.LinkVenuePlacementType_DAL o = new PlacementManager.DAL.LinkVenuePlacementType_DAL();
            o.PlacementTypeId = PlacementTypeId;
            DataSet ds = o.SelectAllWPlacementTypeIdActiveOrdered();
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                listLinkVenuePlacementType.Add(new LinkVenuePlacementType((int)row["VenuePlacementTypeId"], (int)row["VenueId"], (int)row["PlacementTypeId"], (bool)row["IsRestricted"], (int)row["MaxNumStudents"], (bool)row["VenueSuppliedEducator"], (bool)row["IsVenueCharge"], (decimal)row["ChargeAmount"], (int)row["VenueChargeTypeId"], (bool)row["IsConfirmedByVenue"], (bool)row["IsActive"], (DateTime)row["DateCreated"], (string)row["CreatedBy"], (DateTime)row["DateUpdated"], (string)row["UpdatedBy"]));
            }
           
            
            return listLinkVenuePlacementType;
        }
	}
}
